const db = require('../config/db');
const userModel = '../schema/users'; // 定义goods 数据表结构

const Mall = db.MallSequelize; // 引入数据库
const User = Mall.import(userModel); // 使用import方法，实例化Goods

// 用户登录
const login = async function(data) {
  const result = await User.findOne({
    where: {
      stu_name: data.stuName,
      stu_pwd: data.stuPwd,
    }
  })
  return result;
}
// 获取用户列表
const getGoodsList = async function (data) {
  const result = await User.findAll()
  return result;
}
module.exports = {
    login,
    getGoodsList
}
